package SellCar.dao.sell.impl;

import java.util.List;

import org.apache.ibatis.session.SqlSession;
import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Repository;

import SellCar.dao.sell.SellMapper;
import SellCar.pojo.Sell;
import SellCar.utils.MyBatisUtil;
@Repository("sellMapperImpl")
public class SellMapperImpl implements SellMapper{
	@Autowired
	@Qualifier("sqlSessionTemplate")
	private SqlSessionTemplate sqlSessionTemplate;
	public SqlSessionTemplate getSqlSessionTemplate() {
		return sqlSessionTemplate;
	}
	public void setSqlSessionTemplate(SqlSessionTemplate sqlSessionTemplate) {
		this.sqlSessionTemplate = sqlSessionTemplate;
	}

	
	
	public Integer addInfo(String carName, String year, Integer price,
			String particulars, String image) {
		return sqlSessionTemplate.getMapper(SellMapper.class).addInfo(carName, year, price, particulars, image);
	}

	public List<Sell> showSellInfo(String carName, String year, Integer price,
			String particulars, String image) {
		
		return sqlSessionTemplate.getMapper(SellMapper.class).showSellInfo(carName, year, price, particulars, image);
	}

}
